#ifndef TIMER_H_INCLUDED
#define TIMER_H_INCLUDED
#include <SDL/SDL.h>
#include <pthread.h>
// #include <sys/time.h>

#include <iostream>

class Timer
{
	public:
		static Timer* Instance();
		unsigned int elapsed;
		virtual void mark();

		int sdl_now;
		int sdl_lasttime;
		int sdl_firsttime;

// 		struct timeval lasttime;
// 		float timediff(const struct timeval& now, const struct timeval& lasttime);
		
		float		bullet_ms;
		int		dispcounter;
		float		dispsum;

		// mutex
		pthread_mutex_t	 fps_mutex;
	protected:
		Timer();
	private:
// 		static Timer* _instance;
// 		struct timezone timer_tz;
};

#endif
